/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author 王宇
* @date 2024-01-06
**/
@Entity
@Data
@Table(name="dis_user_right")
public class DisUserRight implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "right_id")
    @ApiModelProperty(value = "主键ID")
    private Long rightId;

    @Column(name = "open_id")
    @ApiModelProperty(value = "用户openId")
    private String openId;

    @Column(name = "right_type")
    @ApiModelProperty(value = "权益类型，0：线下售卖，1：线下赠送，2：赠与撤销，3：售卖撤销")
    private Integer rightType;

    @Column(name = "right_status")
    @ApiModelProperty(value = "权益状态，0：无效，1：有效，-1：删除")
    private Integer rightStatus;

    @Column(name = "right_category")
    @ApiModelProperty(value = "权益分类，0：课程")
    private Integer rightCategory;

    @Column(name = "right_content")
    @ApiModelProperty(value = "权益内容")
    private String rightContent;

    @Column(name = "original_open_id")
    @ApiModelProperty(value = "源openId")
    private String originalOpenId;

    public void copy(DisUserRight source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}